import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate';
import app from './modules/app'
import dict from './modules/dict'
import user from './modules/user'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import model_scenario from './modules/model-scenario'
import schemaTree from './modules/schemaTreeList'
import jsonSchema from './modules/jsonSchema'
import systemStyle from './modules/system-style/index'
import homePage from './modules/home-page/index'
import modelManageTool from './modules/model-manage-tool/index'
import scenarioEditTool from './modules/scenario-edit-tool/index'
import experimentDesignTool from './modules/experiment-design-tool/index'
import evaluationAnalysisTool from './modules/evaluation-analysis-tool/index'
import simulationRunTool from './modules/simulation-run-tool/index'
import intelligentTrainingTool from './modules/intelligent-training-tool/index'
import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    dict,
    user,
    tagsView,
    permission,
    settings,
    model_scenario,
    schemaTree,
    jsonSchema,
    systemStyle,
    homePage,
    modelManageTool,
    scenarioEditTool,
    experimentDesignTool,
    evaluationAnalysisTool,
    simulationRunTool,
    intelligentTrainingTool
  },
  getters,
  plugins: [
    createPersistedState({
      storage: window.sessionStorage,
    }),
  ],
})

export default store
